//
//  DetailTaskViewController.swift
//  willdo
//
//  Created by zz on 3/16/18.
//  Copyright © 2018 will do. All rights reserved.
//

import UIKit

class DetailTaskViewController: UIViewController,DetailViewDelegate {

    var detail:DetailView!
    var modle:MyTaskDetailModle!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationController?.isNavigationBarHidden = false
        self.edgesForExtendedLayout = UIRectEdge(rawValue: 0)
        view.backgroundColor = UIColor(red: 247/255.0, green: 247/255.0, blue: 247/255.0, alpha: 247/255.0)
        detail = DetailView(frame: view.frame, modle: modle)
        detail.delegate = self
        view.addSubview(detail)
        // Do any additional setup after loading the view.
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
    }
    
    func receiveBtnClick(){
        
    }
    func commitBtnClick(){
    }
    func redoBtnClick(){
        
    }
    func archieveBtnClick(){
        
    }
    func subTask(){
        navigationController?.pushViewController(MyTaskViewController(), animated: true)
    }
    func communicaBtnClick() {
        navigationController?.pushViewController(CommunicatieViewController(), animated: true)
    }
    
    func taskMember(){
        navigationController?.pushViewController(ExternalMembersViewController(), animated: true)
    }
    
    func taskFile() {
        navigationController?.pushViewController(TaskImageViewController(collectionViewLayout:UICollectionViewFlowLayout()), animated: true)
    }
    
    override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        if (detail.ChangeStateBtn.frame.maxY > 10){
            detail.scrollView.contentSize = CGSize(width: UIScreen.main.bounds.width, height: detail.ChangeStateBtn.frame.maxY+80)
//            print(detail.cellView.frame)
//            print(detail.scrollView.contentSize)
        }
    }

}
